import React, { memo } from "react";
import PropTypes from "prop-types";
import RoomItemWrapper from "./style";
const RoomItem = memo(function RoomItem(props) {
  const { itemWidth = "25%" } = props;
  const { name = "", picture_url } = props.roomObj;
  return (
    <RoomItemWrapper $itemWidth={itemWidth}>
      <div className="inner">
        <div className="cover">
          <img src={picture_url} alt="" />
        </div>
        <div className="room-info">
          <div className="room-type">
            {props.roomObj.verify_info.messages.join(".")}
          </div>
          <div className="room-name">{name}</div>
        </div>
        <div className="rating"></div>
      </div>
    </RoomItemWrapper>
  );
});

RoomItem.propTypes = {
  roomObj: PropTypes.object,
};

export default RoomItem;
